﻿@page
@using Microsoft.AspNetCore.Authorization
@using Microsoft.AspNetCore.Mvc.Localization
@using Volo.Abp.Identity
@using Volo.Abp.Identity.Localization
@using Volo.Abp.Identity.Web.Pages.Identity.Users
@model IndexModel
@inject IHtmlLocalizer<IdentityResource> L
@inject IAuthorizationService Authorization
@section scripts {
    <abp-script-bundle name="@typeof(IndexModel).FullName">
        <abp-script src="/Pages/AbpPermissionManagement/permission-management-modal.js" />
        <abp-script src="/Pages/identity/users/index.js" />
    </abp-script-bundle>
}

<abp-card id="IdentityUsersWrapper">
    <abp-card-header>
        <abp-row>
            <abp-column size-md="_6">
                <h2>@L["Users"]</h2>
            </abp-column>
            <abp-column  size-md="_6" class="text-right">
                @if (await Authorization.IsGrantedAsync(IdentityPermissions.Users.Create))
                {
                    <abp-button button-type="Primary" name="CreateUser" text="@L["NewUser"].Value" icon="plus"/>
                }
            </abp-column>
        </abp-row>
    </abp-card-header>
    <abp-card-body>
        <abp-table striped-rows="true" class="nowrap">
                <thead>
                    <tr>
                        <th>@L["Actions"]</th>
                        <th>@L["UserName"]</th>
                        <th>@L["EmailAddress"]</th>
                        <th>@L["PhoneNumber"]</th>
                    </tr>
                </thead>
        </abp-table>
    </abp-card-body>
</abp-card>